#define _CRT_SECURE_NO_WARNINGS 1

int removeDuplicates(int* nums, int numsSize)
{
    int dest = 0;
    int cur = 1;
    while (cur < numsSize)
    {
        if (nums[cur] == nums[dest])
            cur++;
        else
            nums[++dest] = nums[cur++];
    }
    return dest + 1;
}